package com.zzw.controller;

import com.zzw.entity.Result;
import com.zzw.entity.Statistics;
import com.zzw.service.StatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Project: warehouse
 * @Description:
 * @Author: zzw
 */
@RestController
@RequestMapping("/statistics")
@Slf4j
@Api(tags = "数据统计模块")
public class StatisticsController {

    @Autowired
    private StatisticsService statisticsService;

    /**
     * 统计各个仓库商品库存数量的url接口/statistics/store-invent
     *
     * @return
     */
    @GetMapping("/store-invent")
    @ApiOperation("统计各个仓库商品库存数量")
    public Result statisticsStoreInvent() {
        List<Statistics> statisticsList = statisticsService.statisticsStoreInvent();
        return Result.ok(statisticsList);
    }
}
